studentScore = function (){
	Ext.define('sourseData',{
		extend:'Ext.data.Model',
		id:'sourseDate',
		fields:[
		        	{name:'studentId',type:'string'},
			        {name:'StudentName',type:'string'},
			        {name:'courseName',type:'string'},
			        {name:'grade',type:'string'},
			        {name:'credit',type:'string'},
			        {name:'testScores',type:'string'},
			        {name:'peacetimeScores',type:'string'},
			        {name:'prom',type:'string'},
			        {name:'grade',type:'string'},
			        {name:'hourse',type:'string'},
			        {name:'isAgain',type:'string'},
			        {name:'scores',type:'string'}

			       ]
	});
	
	var sourseStore = Ext.create('Ext.data.Store',{
		//pageSize:8,
		model:sourseData,
		groupField: 'prom',
		autoLoad:true,
		proxy:{
			type:'ajax',
			url:'searchSourseAction.action',
			
			reader:{
				type:'json',
				root:'studentCreditPojo.studentScores'
				//totalProperty:'resultList.total'
			},
			extraParams:{
				jsonString:"{'studentId':'"+STUDENT_ID+"'}",
				studentId : STUDENT_ID
        	}
		},
		listeners: {//为了编辑时设定初始值Ext.getCmp("fwz").setValue(2);  
	        load: function(store,records) {        	
	            Ext.getCmp('studentSourseNameId').setValue(store.proxy.reader.jsonData.studentCreditPojo.studentName);  
	            Ext.getCmp('totalHourseId').setValue(store.proxy.reader.jsonData.studentCreditPojo.totalHourse);  
	            Ext.getCmp('totalCreditId').setValue(store.proxy.reader.jsonData.studentCreditPojo.totalCredit);  
	            Ext.getCmp('totalGetCreditId').setValue(store.proxy.reader.jsonData.studentCreditPojo.totalGetCredit);  
	            
	            
	        }  
	    }

	});
	var sourseGrid = Ext.create('Ext.grid.Panel',{
		store:sourseStore,	
		columnLines:true,
		//selModel:checkBox,
		disableSelection:false,
		width:755,
		loadMask:true,
		columns:[
		         new Ext.grid.RowNumberer(),        
		         {text:'课程名',width:150,dataIndex:'courseName',sortable:true},
		         {text:'学时',width:100,dataIndex:'hourse',sortable:true},
		         {text:"学分",width:100,dataIndex:'credit',sortable:true},
		         {text:"平时成绩",width:100,dataIndex:'peacetimeScores',sortable:true},
		         {text:"考试成绩",width:100,dataIndex:'testScores',sortable:true},
		         {text:"总评成绩",width:100,dataIndex:'scores',sortable:true,
		        	 renderer : function(da){
	        		 if(da < 60){
	        			 return '<span style="color:red"><b>'+da+'</b></span>';
	        		 }else{
	        			 return da;
	        		 }
	        	 }},
		         {text:"其他",width:100,dataIndex:'isAgain',sortable:true,
		        	 renderer : function(da){
		        		 if(da == '1'){
		        			 return '<span style="color:red"><b>补</b></span>';
		        		 }else{
		        			 return "";
		        		 }
		        	 }}
		         ],
		autoHeight:true,
		authWidth:true,
		features: [{ 
			ftype: 'grouping' ,
			groupHeaderTpl:'学年: {name}    ---共{rows.length}条记录'
				}],
		title:"学生成绩信息",
		loadMask:true,
		
	buttonAlign : "center",
	plain:true,
		dockedItems:[{
			dock:'top',
			xtype:'toolbar',
			items:[{
				
					fieldLabel:'姓名',
					name:'studentId',
					id:'studentSourseNameId',
					xtype:'textfield',
					readOnly:true,
					labelWidth:'50px',
					labelAlign:'right'
			},{
				fieldLabel:'总学时',
				name:'totalHourse',
				id:'totalHourseId',
				xtype:'textfield',
				readOnly:true,
				labelWidth:'50px',
				labelAlign:'right'
			},{
				fieldLabel:'总学分',
				name:'totalCredit',
				id:'totalCreditId',
				xtype:'textfield',
				readOnly:true,
				labelWidth:'50px',
				labelAlign:'right'
			},{
				fieldLabel:'实获学分',
				name:'totalGetCredit',
				id:'totalGetCreditId',
				xtype:'textfield',
				readOnly:true,
				labelWidth:'60px',
				labelAlign:'right'
			}]		
		}]
	});
	
	var scorePanel = Ext.create('Ext.panel.Panel',{
		enableTabScroll: true,
		width:'100%',
		height:400,
		//x:100,
		//layout: 'column',
       // layout: 'border',
		//margin:'2 10 3 10',
		//title:"kkkkkk",
		region:'center',
		layout: {
		    type: 'hbox',
		    align: 'middle ',
		    pack: 'center'
		},
		/*layout:{    
			align: 'center',
            type:'table',//表格布局    
            columns:2 //设置表格布局默认列数为2列    
        },*/ 
       items: [sourseGrid]
       
	});
	return scorePanel;
}